import {eventBus} from "../../../../../../eventbus/eventbus";
import {LibraryType} from "../../ElementLibraryTypes";

/**
 * @type {LibraryItem|null}
 */
let curItem = null;

const renameElementLibraryItem = {
  validate(_, item) {
    curItem = item;
    return !item?.system;
  },
  execute() {
    eventBus.emit("renameElementLibraryItem", curItem.id);
  }
};

export default renameElementLibraryItem;